package com.example.controller;

import com.example.pojo.User;
import com.example.service.Userservice;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@RestController
public class UserContrller {
    @Value("${server.port}")
    private String port;
    @Autowired
    private Userservice userservice;

 @RequestMapping("/selectAll")
 public Map<String,Object> sele(@RequestParam String name1,@RequestParam String pwd1) throws InterruptedException {
     System.out.println(name1+pwd1+"生产者"+port);
     if(port.equals("7002")){
         System.out.println("aaaaaa");
         Thread.sleep(1000);
     }
     Map<String, Object> login = userservice.login(name1, pwd1);
     System.out.println(login);
     System.out.println(login+"bbbb");
     return login ;
 }
}
